<template>
  <div>
    <div id="main" style="width: 1500px;height: 1500px;"></div>


  </div>
</template>

<script>
import * as echarts from 'echarts';
import myaxios from "@/http/axios";
export default {
  name: "test",
  data() {
    return {
      data1: '',
      llist:[]
    }
  },
  methods: {
    get_show(){
      var chartDom = document.getElementById('main');
      var myChart = echarts.init(chartDom);
      var option;

      option = {
        xAxis: {
          type: 'category',
          data: this.llist[1]
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: this.llist[0],
            type: 'line'
          }
        ]
      };

      option && myChart.setOption(option);

    },
    get_data(){
      myaxios('tttttt','get').then(res=>{
        this.llist = res.list
      })
      this.get_show()
      setInterval(this.get_data,10000)
    }
  },
  mounted() {
    this.get_data()
  },

}
</script>

<style scoped>

</style>